import request from '@/plugins/axios'

export const getListBookByPage = (params) => {
  return request({
    method: 'POST',
    url: `/book/list/page`,
    data: params,
  })
}

export const addBook = (data) => {
  return request({
    method: 'POST',
    url: `/book/add`,
    data,
  })
}

export const updateBook = (data) => {
  return request({
    method: 'POST',
    url: `/book/update`,
    data,
  })
}

export const getByBookId = (params) => {
  return request({
    method: 'GET',
    url: `/book/get`,
    params,
  })
}

export const getListBook = (params) => {
  return request({
    method: 'GET',
    url: `/book/list`,
    params,
  })
}

export const deleteBook = (data) => {
  return request({
    method: 'POST',
    url: `/book/delete`,
    data,
  })
}
